<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="file" name="file" id="ifle" onchange="upload.call(this)">

    <script>
        function upload() {
            var fileReader = new FileReader();
            fileReader.readAsDataURL(this.files[0])
            fileReader.onload=function(){
                console.log(this.result);
            }
        }
    </script>
</body>
</html>